package com.hoan.component.kotlin

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.blankj.utilcode.util.ConvertUtils
import com.blankj.utilcode.util.Utils
import com.hoan.component.kotlin.databinding.ActivityPopBinding
import com.lxj.xpopup.XPopup
import com.lxj.xpopup.util.XPopupUtils

/**
 *
 *
 * @author chenqiang
 * @date  2024/5/16
 */
class PopActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        val binding = ActivityPopBinding.inflate(layoutInflater)
        setContentView(binding.root)

        binding.tvPop.setOnClickListener {
            XPopup.Builder(this@PopActivity)
                .autoFocusEditText(false)
                .popupHeight(
                    XPopupUtils.getScreenHeight(this@PopActivity) - ConvertUtils.dp2px(55f)
                ).asCustom(object : CouponPop(this@PopActivity) {
                    override fun operate(dialog: CouponPop, type: Int) {

                    }
                })
                .show()
        }
    }

}